package com.bzframework.pro.authorize.web;

import com.bzframework.pro.authorize.annotation.Authorization;
import com.bzframework.pro.notify.email.EmailManager;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

/**
 * @Author bingzhong
 * @Date 2025/1/23 14:00
 * @Description
 */
@Tag(name = "邮件管理")
@RestController
@RequestMapping("/email")
@RequiredArgsConstructor
public class EmailController {

    private final EmailManager emailManager;

    @GetMapping("/captcha")
    @Operation(summary = "邮箱登录发送验证码")
    @Authorization(ignore = true)
    public Mono<Boolean> sendCaptcha(@RequestParam String to) {
        return emailManager.sendEmailCaptcha(to);
    }

}
